﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Adams.Web.Logic.DailyPrayers
{
    public static class Index
    {
        public static Models.DailyPrayers.Index.PageLoad PageLoad(string location, string month)
        {
            int m = DateTime.Now.Month;

            if (string.IsNullOrEmpty(location))
            {
                location = "0";
            }

            bool isHijri = Adams.Shared.CalendarHelper.IsMonthHijri(month);

            if (!string.IsNullOrEmpty(month))
            {
                if (isHijri)
                {
                    m = Adams.Shared.CalendarHelper.GetHijriMonthID(month);
                }
                else
                {
                    m = Adams.Shared.CalendarHelper.GetMonthID(month);
                }
            }

            return Data.DailyPrayers.Index.PageLoad(location, m, isHijri);
        }
    }
}